home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / info-service / gopher / Unix / gopher+1.2b4 / object / DAarray.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-02-11  |  1.6 KB  |  68 lines

  1. /********************************************************************
  2.  * lindner
  3.  * 3.1.1.1
  4.  * 1993/02/11 18:03:06
  5.  * /home/mudhoney/GopherSrc/CVS/gopher+/object/DAarray.h,v
  6.  * Exp
  7.  *
  8.  * Paul Lindner, University of Minnesota CIS.
  9.  *
  10.  * Copyright 1991, 1992 by the Regents of the University of Minnesota
  11.  * see the file "Copyright" in the distribution for conditions of use.
  12.  *********************************************************************
  13.  * MODULE: DAarray.h
  14.  * Dynamic Array Header file/abstraction
  15.  *********************************************************************
  16.  * Revision History:
  17.  * DAarray.h,v
  18.  * Revision 3.1.1.1  1993/02/11  18:03:06  lindner
  19.  * Gopher+1.2beta release
  20.  *
  21.  * Revision 1.2  1992/12/21  20:04:04  lindner
  22.  * Added DAcpy()
  23.  *
  24.  * Revision 1.1  1992/12/10  23:27:52  lindner
  25.  * gopher 1.1 release
  26.  *
  27.  *
  28.  *********************************************************************/
  29.  
  30.  
  31. #ifndef DAARRAY_H
  32. #define DAARRAY_H
  33.  
  34. /*
  35.  *  A dynamic array class
  36.  */ 
  37.  
  38. struct da_struct {
  39.      char **objects;  /** Should be void** perhaps */
  40.      
  41.      int Top;
  42.      int maxsize;
  43.  
  44.      char * (*newfn)();
  45.      void   (*initfn)();
  46.      void   (*destroyfn)();
  47.      char * (*copyfn)();
  48. };
  49.  
  50. typedef struct da_struct DynArray;
  51.  
  52. #define DAgetEntry(a,b)   (((a)->objects[b]))
  53. #define DAgetTop(a)       ((a)->Top)
  54. #define DAsetTop(a,b)     ((a)->Top=(b))
  55. #define DAgetNumitems(a)   ((a)->Top)
  56.  
  57. DynArray *DAnew();
  58. void     DAdestroy();
  59. void     DAinit();
  60. void     DApush();
  61. char *   DApop();
  62. void     DAsort();
  63. void     DAgrow();
  64. void     DAsort();
  65. void     DAcpy(/* dest, orig */);
  66. #endif
  67.  
  68.